package com.t235.gc.device.controller;

import com.t235.gc.AjaxResult;
import com.t235.gc.device.service.GarbageReadmeterRecordService;
import com.t235.gc.devicevo.GarbageReadmeterRecordVo;
import com.t235.gc.entity.GarbageReadmeterRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description : 清理记录
 * Created by Li on 2021-03-31 08:36:48
 */
@RestController
@RequestMapping("/api/garbage-readmeter-record/admin")
public class GarbageReadmeterRecordController {
    @Autowired
    private GarbageReadmeterRecordService garbageReadmeterRecordService;

    @GetMapping("/getBackGarbageReadmeterRecordList")
    public AjaxResult getBackGarbageReadmeterRecordList(GarbageReadmeterRecordVo recordParam) {
        return AjaxResult.success(garbageReadmeterRecordService.getBackGarbageReadmeterRecordList(recordParam));
    }

    @GetMapping("/updGarbageReadmeterRecord")
    public AjaxResult updGarbageReadmeterRecord(GarbageReadmeterRecord record) {
        if (!(garbageReadmeterRecordService.updGarbageReadmeterRecord(record) > 0)) {
            return AjaxResult.error("修改失败");
        }
        return AjaxResult.success("修改成功");
    }
}
